{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "# Proportions of the Golden Section"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 2,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "import matplotlib.pyplot as pt\n",
        "from math import sqrt"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "a = 0\n",
        "b = 1\n",
        "\n",
        "m1 = a + (1-(sqrt(5)-1)/2) * (b-a)\n",
        "m2 = a + (sqrt(5)-1)/2 * (b-a)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "metadata": {
        "collapsed": false
      },
      "outputs": [
        {
          "data": {
            "text/plain": [
              "[<matplotlib.lines.Line2D at 0x7fa0717e64e0>]"
            ]
          },
          "execution_count": 7,
          "metadata": {},
          "output_type": "execute_result"
        },
        {
          "data": {
            "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAD/CAYAAAD4xAEfAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAElhJREFUeJzt3H2QXeVdwPFvQl54y2bRggVlurLQKeMU14ITaDBsWxIK\ngcrEUQuOZnGoFJ2Ewoy1JbyUOnRaHShNhoIiWCiOVqalE9lpEhzZRoLlpSOl6lCalZ0W5bU22Qgm\nkLD+8ZzNntzsZs+959l77j7n+5m5k/Pc59x7Hn6cPb+9v9+5C5IkSZIkSZIkSZIkSZIkSaqZucCd\nwGPAI0Bvw/xFwBPZ/OW55z+dPfcksHrmlylJim0VcE+2vQT4Zm5uPvBDYHG2/QRwHNAPbMz2OQq4\nqR0LlSQdbF6J1y4FNmXbjwNn5OZOBbYDO7Pxo8Ay4H3A9wnJogv44xLHlySVUCYBdAGjufE+Qlno\n7WxuZ25uF+HTwDuAdwErgZMInwbeU2INkqQWlUkAo8Ci3Hj84g/h4p+fWwTsAH4CPAvsBZ4DdhOS\nwmsl1iFJasHcEq/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bc+YQftuPaurrZ5VCxBPgq8CttXdHs90ngGcJFPs9zs3lTxRKaPDc74W8BFfli2enAzwP/REgQ\nHZXVOkT+y3ePc+AttqcS7hDYCbxF+KS1rK2rm10OFUsI5+O1wD8Dn2rjumaz7YTE2njjiedm86aK\nJTR5bnZCAijyxbL/JpR9Ppj9e397ljarNMZxHxP/f/NfzIPJY6wJh4olwN8CVxDOx7MJd77p0L7B\n5Hf8eW42b6pYQpPnZickgCJfLHuKiRLQNuCENqxrtmmM41zg7Wx7Z8PcIuCnbVrXbHSoWAJ8ifDF\nxrcIn0gtB7XOczOups7NTkgAbwBvMvHFshWEvyKadwPwiWz7l4EftW11s8c24IJs+0xCjXDcs8Ap\nhD+/sYDwEftf2rq62eVQsVwMfB84inC+fpDwC4pa47kZT9Pn5rw2LCrvI0z+xbKPA3/DxBfLnszm\nxr9Y9nlC2ecCwkefgTasdbZ5EFhOuHgBXEb4i61HA3cRvp29mZD07wZerGCNs8V0sfwU4Q6LPcA/\nMtEv0PTGsn89N8ubLJaem5IkSZIkSZIkSZIkSZIkSZIkSZKUkv8Hv4PiiLPgGGYAAAAASUVORK5C\nYII=\n",
            "text/plain": [
              "<matplotlib.figure.Figure at 0x7fa0717e6a58>"
            ]
          },
          "metadata": {},
          "output_type": "display_data"
        }
      ],
      "source": [
        "pt.xlim([a-0.5, b+0.5])\n",
        "pt.grid()\n",
        "pt.plot([a,b], [0,0], \"ob\")\n",
        "pt.plot([m1, m2], [0,0], \"or\")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": []
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.5.1+"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}